﻿using System.Collections.Generic;

namespace Scenario_Editor.Tool
{
    /// <summary>
    /// Stores polygons IDs whichs uses the given material ID.
    /// </summary>
    internal class MeshPolygonData
    {
        #region Private Fields

        private int materialId;

        /// <summary>
        /// first MaterialID and the polygonIds which uses it.
        /// </summary>
        private List<int> polygonIds;

        #endregion Private Fields

        #region Public Constructors

        /// <summary>
        /// Stores a list of polygons IDs whichs uses the given material ID.
        /// </summary>
        /// <param name="materialId"></param>
        /// <param name="polygonIds"></param>
        public MeshPolygonData(int materialId, List<int> polygonIds)
        {
            this.materialId = materialId;
            this.polygonIds = polygonIds;
        }

        #endregion Public Constructors

        #region Public Properties

        public int MaterialId
        {
            get { return materialId; }
            private set { materialId = value; }
        }

        public List<int> PolygonIds
        {
            get { return polygonIds; }
            private set { polygonIds = value; }
        }

        #endregion Public Properties

        #region Public Methods

        public void AddPolygonID(int polygonID)
        {
            if (!this.PolygonIds.Contains(polygonID))
                this.PolygonIds.Add(polygonID);
        }

        #endregion Public Methods
    }
}